import { reactive, ref } from "vue";

export default function InitHook() {
  const tableRef = ref<any>(null);
  const activeKey = ref<string>("5");
  const pageStat = ref<Base.GeneraDataType>({
    "10": 0,
    5: 0,
    6: 0,
    7: 0,
    8: 0,
    9: 0,
    "-5": 0
  });
  const searchForm = reactive<SingleOrderApproval.SearchForm>({
    companyIdList: [],
    waybillNums: "",
    customerNames: "",
    state: "",
    bizIdList: [],
    followIdList: [],
    companyNames: "",
    channelIdList: [],
    finIdList: [],
    isTransferBill: "",
    depositTime: [],
    accountPeriodIdList: [],
    customerIdList: [],
    beforePageNum: 0,
    pageNum: 1,
    pageSize: 100,
    total: 0
  });
  const tableData = ref<Array<BusinessWaybill.ListRows>>([]);
  const saPageInfo = ref<Base.GeneraDataType>({});
  const dialogOpts = reactive<Base.DialogOpts>({
    title: "",
    width: "520px",
    component: "",
    visible: false,
    type: 1,
    passData: {}
  });
  const drawerOpts = reactive<Base.DrawerOpts>({
    title: "",
    width: "520px",
    component: "",
    visible: false,
    type: 1,
    passData: {}
  });
  return {
    searchForm,
    tableData,
    dialogOpts,
    drawerOpts,
    tableRef,
    saPageInfo,
    activeKey,
    pageStat
  };
}
